@tailwind base;
@tailwind components;
@tailwind utilities;

@font-face {
  font-family: 'OPPOSans';
  src: url('/fonts/OPPOSans-R.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'OPPOSans';
  src: url('/fonts/OPPOSans-B.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Cervanttis';
  src: url('/fonts/Cervanttis.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --foreground-rgb: 255, 255, 255;
  --background-rgb: 29, 29, 32;
  --transition-duration: 300ms;
  --primary-color: #29654d;
  --secondary-color: #41ffb3;
  --tag-background: #273C36;
}

/* 浅色主题变量 */
body.light-theme {
  --foreground-rgb: 0, 0, 0;
  --background-rgb: 255, 255, 255;
  --tag-background: #f0f9f6;
}

body {
  color: rgb(var(--foreground-rgb));
  background: rgb(var(--background-rgb));
  font-family: 'PingFang SC', sans-serif;
  transition: background var(--transition-duration), color var(--transition-duration);
}

@layer components {
  .container-safe {
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  @media (min-width: 640px) {
    .container-safe {
      max-width: 640px;
    }
  }
  
  @media (min-width: 768px) {
    .container-safe {
      max-width: 768px;
    }
  }
  
  @media (min-width: 1024px) {
    .container-safe {
      max-width: 1024px;
    }
  }
  
  @media (min-width: 1280px) {
    .container-safe {
      max-width: 1280px;
    }
  }
  
  @media (min-width: 1440px) {
    .container-safe {
      max-width: 1440px;
    }
  }
  
  @media (min-width: 1920px) {
    .container-safe {
      max-width: 1920px;
      padding-left: 270px;
      padding-right: 270px;
    }
  }
  
  .gradient-green {
    background: linear-gradient(180deg, rgba(var(--primary-color-rgb, 41, 101, 77), 0.15) 0%, rgba(var(--secondary-color-rgb, 65, 255, 179), 0.27) 100%);
  }
  
  .gradient-green-2 {
    background: linear-gradient(180deg, rgba(var(--primary-color-rgb, 41, 101, 77), 0.15) 0%, rgba(30, 255, 165, 0.95) 100%);
  }
  
  .nav-link {
    @apply text-base font-normal text-white hover:text-secondary transition-colors;
  }
  
  .tag-bubble {
    background-color: var(--tag-background);
    @apply text-white rounded-full px-4 py-2 shadow-md;
  }
  
  .animate-hello {
    animation: fadeIn 1.2s ease forwards;
    opacity: 1 !important;
    transform: translateY(0) !important;
    will-change: opacity, transform;
  }
  
  .animate-fadeIn {
    animation: fadeIn 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    will-change: opacity, transform;
  }
  
  .animate-slideInFromLeft {
    animation: slideInFromLeft 1s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    will-change: opacity, transform;
  }
  
  .animate-slideInFromRight {
    animation: slideInFromRight 1s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    will-change: opacity, transform;
  }
  
  .animate-pulse-slow {
    animation: pulseSlow 4s ease-in-out infinite;
    will-change: opacity, transform;
  }
  
  @keyframes fadeIn {
    from {
      opacity: 0;
      transform: translateY(20px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  @keyframes slideInFromLeft {
    from {
      opacity: 0;
      transform: translateX(-20px);
    }
    to {
      opacity: 1;
      transform: translateX(0);
    }
  }
  
  @keyframes slideInFromRight {
    from {
      opacity: 0;
      transform: translateX(20px);
    }
    to {
      opacity: 1;
      transform: translateX(0);
    }
  }
  
  @keyframes pulseSlow {
    0% {
      opacity: 0.8;
      transform: scale(1);
    }
    50% {
      opacity: 1;
      transform: scale(1.05);
    }
    100% {
      opacity: 0.8;
      transform: scale(1);
    }
  }

  .header-image-hover {
    transition: transform 0.5s ease;
    will-change: transform;
  }

  .header-image-hover:hover {
    transform: scale(1.03);
  }
}

@keyframes waving-hand {
  0% { transform: rotate(0deg); }
  10% { transform: rotate(14deg); }
  20% { transform: rotate(-8deg); }
  30% { transform: rotate(14deg); }
  40% { transform: rotate(-4deg); }
  50% { transform: rotate(10deg); }
  60% { transform: rotate(0deg); }
  100% { transform: rotate(0deg); }
}

.waving-hand {
  display: inline-block;
  animation: waving-hand 2.5s infinite;
  transform-origin: 70% 70%;
  will-change: transform;
} 